#pragma once
#include "tpcolorbase.h"

class CTPGradientCenterPolygon :public CTPColorBase
{
public:
	CTPGradientCenterPolygon(void);
	virtual ~CTPGradientCenterPolygon(void);
public:
	virtual BOOL FillColor(LPVOID pColorData, BYTE* & pBuffer, int nWidth, int nHeight, eBufferFormat eFormat) ;
	virtual int	 SaveColorToBuffer(LPVOID pColorDef, LPVOID	lpBuffer, int nLength) ;
	virtual int	 LoadColorFromBuffer(LPVOID hColor,LPVOID	lpBuffer,int nLength) ;

private:
	BOOL		FillInCMethod(LPVOID pColorData, BYTE* & pBuffer, int nWidth, int nHeight, eBufferFormat eFormat) ;
	BOOL		InHorTraingle(int nWidth,int nHeight,float nX, float nY);
	float		MultiVector(float fStart1, float fEnd1,float fStart2, float fEnd2);
};
